#include<iostream>
#include<signal.h>
#include<unistd.h>
//信号如何产生
 //1、键盘产生信号（ctrl + c, ctrl + \) ctrl + \可以发送终止信号并产生core dump文件用于事后调试

void hander(int signumber)
{
   std::cout << "我是:" << getpid() << ", 我获得了一个信号" << signumber << std::endl;
}


int main()
{

  std::cout << "我是进程：" << getpid() << std::endl;
  signal(SIGQUIT, hander);
  while(true)
  {
     std::cout << "I am a process, I am waiting signal!" << std::endl;
     sleep(1);
  }

  return 0;
}
